package priv.pattern.strategy.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import priv.pattern.strategy.StrategyContext;

/*
 * 作者：m鹏h
 * 时间；2024/5/29 22:43
 * 描述： 策略模式
 **/
@RestController
public class StrategyController {

 @Autowired
 private StrategyContext context;


 @RequestMapping("/method")
 public String method(Integer code) {
  String method = context.getInstance(code).method();
  return method;
 }

}
